from selenium import webdriver
import time
from selenium.webdriver.common.by import By

driver=webdriver.Chrome(r'D:\bianchengerbianchenger\driver\chromedriver.exe')
driver.get('https://www.bilibili.com/')
driver.maximize_window()
time.sleep(1)
driver.find_element(By.XPATH,'/html/body/div[2]/div[2]/div[1]/div[3]/div[1]/a[2]/span').click()
time.sleep(1)
#换第二页
cls=driver.window_handles
driver.switch_to.window(cls[1])

driver.find_element(By.XPATH,'/html/body/div[3]/div/div[1]/div[3]/div/span').click()



all_vidio=driver.find_elements(By.CSS_SELECTOR,'[class="card-list"]')

for i in all_vidio:
    a1 = i.find_element(By.CSS_SELECTOR,'div[class="video-card__info"] p').text
    a2 = i.find_element(By)
    print("a1{} a2{}".format(a1,a2))



